#@embedLayout()


#define content()

<form id="zoneFormId" method="post">
    <input type="hidden" id="zone_id" name="fileZone.zone_id">

    <div style="padding: 15px 15px;">
        <label for="zoneName">区域名称:</label>
        <input class="easyui-textbox" type="text" id="zoneName" style="width:70%;" name="fileZone.zone_name"
               data-options="required:true"/>
    </div>

    <div style="padding: 15px 15px;">
        <label for="zoneName">保留天数:</label>
        <input class="easyui-numberspinner" type="text" id="retainDays" style="width:70%;" name="fileZone.retain_days"
               data-options="required:true"/>
    </div>

    <div style="padding: 15px 15px;">
        <label for="zoneName">文件目录:</label>
        <input class="easyui-textbox" type="text" id="directory" style="width:70%;" name="fileZone.directory"
               data-options="required:true"/>
    </div>

    <div style="padding: 15px 15px;">
        <label for="uploadFiles">选择文件:</label>
        <input class="easyui-filebox" type="text" id="uploadFiles" style="width:70%;" name="uploadFiles"
               data-options="required:true,multiple:true"/>
    </div>

</form>

#end


#define css()
<style type="text/css">

    .form-control-div {
        padding: 15px 15px;
    }
</style>

#end


#define js()

<script type="text/javascript">

    $(function () {
        var zoneName = "文件自动删除-" + new Date().getTime();
        $('#zoneName').val(zoneName);
    });

    function datagrid_save(opr_type) {
        var url = '';
        if (opr_type == 'add') {
            url = contextRootPath + '/zoneSave';
        } else {
            url = contextRootPath + '/zoneUpdate';
        }

        $('#zoneFormId').form('submit', {
            url: url,
            onSubmit: function () {
                var flag = $(this).form('enableValidation').form('validate');
                return flag;
            },
            success: function (data) {

                var params = {};
                params.element = _datagrid;
                params.data = data;
                resultCallback(params);
            },
            onLoadError: function () {
                $.messager.alert('温馨提示', '由于网络或服务器太忙，提交失败，请重试！');
            }
        });
    }
</script>

#end


